document.addEventListener('DOMContentLoaded', function() {
    const toggleRoutingKey = () => {
        const isExchange = document.getElementById('destExchange').checked;
        document.getElementById('routingKeyGroup').style.display = isExchange ? 'block' : 'none';
    };
    // 【修复】监听正确的 input name
    document.querySelectorAll('input[name="destinationType"]').forEach(radio => {
        radio.addEventListener('change', toggleRoutingKey);
    });
    // Initial check
    toggleRoutingKey();
}); 